﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebEntities.Models.WebInfo
{
    public class Honor
    {
        public int HonorID { get; set; }
        public string HonorName { get; set; }
        public int HonorTypeId { get; set; }
        public string HonorTypeName { get; set; }
        public string AwardUnit { get; set; }
        public string AwardTime { get; set; }
        public string TitleImg { get; set; }
        public string OriginImg { get; set; }
        public DateTime CreateTime { get; set; }
        public string Creator { get; set; }
        public int? SortNum { get; set; }
        public string ImgType { get; set; }

        public static Honor AsHonor(WI_Honor wihonor)
        {
            Honor honor = new Honor
            {
                HonorID = wihonor.HonorID,
                HonorName = wihonor.HonorName,
                HonorTypeId = wihonor.HonorTypeID,
                HonorTypeName = (wihonor.WI_HonorType != null ? wihonor.WI_HonorType.HonorTypeName : string.Empty),
                AwardUnit = wihonor.AwardUnit,
                AwardTime = wihonor.AwardTime,
                TitleImg = wihonor.TitleImg,
                OriginImg = wihonor.OriginImg,
                CreateTime = wihonor.CreateTime,
                Creator = wihonor.Creator,
                SortNum = wihonor.SortNum,
                ImgType = wihonor.ImgType
            };
            return honor;
        }
    }
}
